import javax.swing.filechooser.FileFilter;

public class FNameSuffixFilter extends FileFilter{
        private String description;
        private String[] extensions;

        public FNameSuffixFilter(String descript, String[] exten){
                this.description = descript;
                this.extensions = exten;
        }

        public String[] getExtensions(){
                return extensions;
        }

        public String getDescription(){
                return description;
        }

        public boolean accept(java.io.File file){
                boolean accepts = false;
                String fileName = file.getName();

                for(int i = 0; i < extensions.length; i++){
                        if(fileName.endsWith(extensions[i]) || file.isDirectory()){
                                accepts = true;
                        }
                }
                return accepts;
        }
}